Skip to contentSkip to conversation

RTE flow: non-ip packets are not delivered when RSS hash type ESP is used

Bug 1173 [email protected] 1 participant 1 message Mar 6, 2023

lore
Share & tools
lore

[email protected]

author Acked-by Matan Azrad
#0 lore raw

https://bugs.dpdk.org/show_bug.cgi?id=1173

Bug ID: 1173
Summary: RTE flow: non-ip packets are not delivered when RSS
hash type ESP is used
Product: DPDK
Version: 22.11
Hardware: x86
OS: Linux
Status: UNCONFIRMED
Severity: normal
Priority: Normal
Component: ethdev
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---

[Overview]
Non-ip packets such as ARP or LACP are not delivered if you use RTE flow rule with empty pattern and rss action with specific combination of RSS hash types:
"ipv4-tcp ipv4-udp ipv4-other ipv6-tcp ipv6-udp ipv6-other esp".

[Steps to Reproduce] - testpmd
sudo dpdk-testpmd -c f -n 4 -a 0000:af:00.0 -- -i
testpmd> port stop 0
testpmd> flow isolate 0 1
testpmd> port start 0
testpmd> flow create 0 group 0 ingress pattern end actions rss types ipv4-tcp ipv4-udp ipv4-other ipv6-tcp ipv6-udp ipv6-other esp end / end testpmd> start

# generate packets by scapy 
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

sendp(Ether(dst="01:00:00:00:00:00")/IP(), iface="ens4f1np1", count=10) sendp(Ether(dst="01:00:00:00:00:00")/ARP(), iface="ens4f1np1", count=10) sendp(Ether(dst="01:00:00:00:00:00")/LACP(), iface="ens4f1np1", count=10)

testpmd> stop
---------------------- Forward statistics for port 0 ----------------------
RX-packets: 10 RX-dropped: 0 RX-total: 10
TX-packets: 10 TX-dropped: 0 TX-total: 10
----------------------------------------------------------------------------

[Actual Results]
non-ip packets such as ARP or LACP are not delivered to the dpdk.

[Expected Results]
non-ip packets such as ARP or LACP packets should be delivered to dpdk

If you use a different pattern such as void instead of the empty pattern or omit one of the RSS hash types mentioned in the previous example, the problem disappears and non-ip packets such as ARP and LACP are correctly delivered to the DPDK

Example of flow rules for dpdk-testpmd that works correctly:

# use pattern void instead empty
testpmd> flow create 0 group 0 ingress pattern void / end actions rss types
ipv4-tcp ipv4-udp ipv4-other ipv6-tcp ipv6-udp ipv6-other esp end / end
# omit RSS hash type esp
testpmd> flow create 0 group 0 ingress pattern end actions rss types ipv4-tcp
ipv4-udp ipv4-other ipv6-tcp ipv6-udp ipv6-other end / end
# omit RSS hash type ipv4-tcp
testpmd> flow create 0 group 0 ingress pattern end actions rss types ipv4-udp
ipv4-other ipv6-tcp ipv6-udp ipv6-other esp end / end

[DPDK version]
commit f262f16087ea6a77357a915cf4c0d10ddc7b6562 (HEAD, tag: v22.11, origin/releases)

Author: Thomas Monjalon <[email protected]>
Date:   Sun Nov 27 11:36:36 2022 +0100

version: 22.11.0

[OS version]
Operating System: Oracle Linux Server 8.7
Kernel: Linux 4.18.0-348.12.2.el8_5.x86_64
Architecture: x86-64

[Network devices]
0000:af:00.0 'MT2892 Family [ConnectX-6 Dx] 101d' if=ens4f0np0 drv=mlx5_core unused=
0000:af:00.1 'MT2892 Family [ConnectX-6 Dx] 101d' if=ens4f1np1 drv=mlx5_core unused=

[OFED]
MLNX_OFED_LINUX-5.7-1.0.2.0

[Bad commit]
commit 18ca4a4ec73a2e28df45a10543b7cdd45f2801dd (HEAD)

Author: Raja Zidane <[email protected]>
Date:   Thu May 12 12:17:11 2022 +0300

net/mlx5: support ESP SPI match and RSS hash

In packets with ESP header, the inner IP will be encrypted, and its fields cannot be used for RSS hashing. So, ESP packets can be hashed only by the outer IP layer.
So, when using RSS on ESP packets, hashing may not be efficient, because the fields used by the hash functions are only the outer IPs, causing all traffic belonging to all tunnels between a given pair of GWs to land on one core.
Adding the SPI hash field can extend the spreading of IPsec packets.

 doc/guides/nics/features/mlx5.ini      |  1 +
 doc/guides/nics/mlx5.rst               |  1 +
 doc/guides/rel_notes/release_22_07.rst |  1 +
 drivers/common/mlx5/linux/meson.build  |  2 ++
 drivers/common/mlx5/mlx5_prm.h         |  5 +++-
 drivers/net/mlx5/mlx5_defs.h           |  2 +-
 drivers/net/mlx5/mlx5_devx.c           |  4 +++-
 drivers/net/mlx5/mlx5_flow.c           | 84
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 drivers/net/mlx5/mlx5_flow.h           | 20 ++++++++++++++++
 drivers/net/mlx5/mlx5_flow_dv.c        | 88
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 10 files changed, 203 insertions(+), 5 deletions(-)
Signature · 2 lines
You are receiving this mail because:
You are the assignee for the bug.